/*
Copyright (C) 2009-2010 Xanadu Development Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#pragma once

#include "LifeMapObject.h"

class Player;
class Skill;

class Summon : public LifeMapObject {
private:
	int skillLevel;
	int skillid;
	int movType;
	int hp;
	static int ids;
public:
	Summon(int skill, int skillLvl) {
		int type;
		this->skillid = skill;
		this->skillLevel = skillLvl;
		this->hp = 0;
		switch(skill) {
			case 3111002: // Puppet ranger
			case 3211002: // Puppet sniper
			case 13111004: // Puppet
			case 5211001: // Octopus
			case 5220002: // Wrath Of The Octopi
				type = 0; // No movement - Puppets and Octopus
				break;
            case 2311006: // Summon Dragon
            case 3111005: // Silver Hawk
			case 3211005: // Golden Eagle
			case 3121006: // Phoenix
			case 3221005: // Frostprey
			case 5211002: // Giovatia
				type = 3; // Flying - Birds and Priest dragon
				break;
			default:
				type = 1; // Follow - 4th job mage summons
				break;
		}
		this->movType = type;
		((MapObject*)this)->setID(this->ids++);
	}
	bool isPuppet(int skillid) {
		return (skillid == 3211002 || skillid == 3111002 || skillid == 13111004);
	}
	int getSkillLevel() {
		return skillLevel;
	}
	void setSkillLevel(int level) {
		this->skillLevel = level;
	}
	int getSkillid() {
		return skillid;
	}
	void setSkillid(int id) {
		this->skillid = id;
	}
	int getHp() {
		return hp;
	}
	void setHp(int hp) {
		this->hp = hp;
	}
	int getMovType() {
		return movType;
	}
	void setMovType(int type) {
		this->movType = type;
	}
	int getObjectID(){
		return ((MapObject*)this)->getID();
	}
};
